<?php
declare(strict_types=1);

namespace App\Http\Controllers\Ai;

use App\Http\Controllers\Controller;
use App\Http\Requests\Ai\FlagStudioImageValidate;
use App\Library\Response;
use App\Logic\User\Service\Ai\FlagStudioService;
use Illuminate\Http\JsonResponse;

class FlagStudioController extends Controller
{
    public function text2Image(FlagStudioImageValidate $validate): JsonResponse
    {
        $imageList = (new FlagStudioService())->serviceCreate(request()->all());
        if (!isset($imageList["code"])) {
            return Response::success($imageList);
        }
        return Response::error();
    }
}
